const _ = require('lodash');

module.exports = (app) => {
  app.use((req, res, next) => {
    const user = req.user;
    if (_.isEmpty(user)) res.cookie('userId', 'null', { maxAge: 0 });
    next();
  });
};
